<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="cw" uri="/widget-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>表格</title>
		<cw:base></cw:base>
		<jsp:include page="/pages/include/nocache.jsp"></jsp:include>
		<script type="text/javascript" src="${pageContext.request.contextPath}/resource/scripts/utils.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/resource/scripts/formUtils.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/resource/scripts/gridUtils.js"></script>
		<style type="text/css">
			.gridSelect-caption {
				background-color: #D0DEF0;
			}
			.biaoti{font-size:12px;}
			.required{color:red}
		</style>
	</head>
	<body>
		<cw:tab id="gridElementsTab" activeTab="0" autoScroll="false" listeners="{'tabchange':tabChg}">
			<cw:panel id="baseGridPan" contentId="baseGridDiv" title="<span class='biaoti'>基本表格</span>" autoHeight="true"/>
			<cw:panel id="countGridPan" contentId="countGridDiv" title="<span class='biaoti'>统计表格</span>" autoHeight="true"/>
			<cw:panel id="exportGridPan" contentId="exportGridDiv" title="<span class='biaoti'>导出表格</span>" autoHeight="true"/>
			<cw:panel id="editGridPan" contentId="editGridDiv" title="<span class='biaoti'>可编辑表格</span>" autoHeight="true"/>
			<cw:panel id="dyncGridPan" contentId="dyncGridDiv" title="<span class='biaoti'>动态表格</span>" autoHeight="true"/>
			<cw:panel id="groupGridPan" contentId="groupGridDiv" title="<span class='biaoti'>分组表格</span>" autoHeight="true"/>
			<cw:panel id="attributeGridPan" contentId="attributeGridDiv" title="<span class='biaoti'>属性表格</span>" autoHeight="true"/>
			<cw:panel id="treeGridPan" contentId="treeGridDiv" title="<span class='biaoti'>树表格</span>" autoHeight="true"/>
			<cw:panel id="selfDefinitionGridPan" contentId="selfDefinitionGridDiv" title="<span class='biaoti'>自定义表格</span>" autoHeight="true"/>
		</cw:tab>
		
		<div id="baseGridDiv">
			<iframe src="" id="baseGridFrame" name="baseGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="countGridDiv">
			<iframe src="" id="countGridFrame" name="countGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="exportGridDiv">
			<iframe src="" id="exportGridFrame" name="exportGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="editGridDiv">
			<iframe src="" id="editGridFrame" name="editGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="dyncGridDiv">
			<iframe src="" id="dyncGridFrame" name="dyncGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="groupGridDiv">
			<iframe src="" id="groupGridFrame" name="groupGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="attributeGridDiv">
			<iframe src="" id="attributeGridFrame" name="attributeGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="treeGridDiv">
			<iframe src="" id="treeGridFrame" name="treeGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="selfDefinitionGridDiv">
			<iframe src="" id="selfDefinitionGridFrame" name="selfDefinitionGridFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		<br>
		<cw:theme></cw:theme>
	</body>
	<script type="text/javascript">
		var baseGridFlag = true;
		var countGridFlag = true;
		var exportGridFlag = true;
		var editGridFlag = true;
		var dyncGridFlag = true;
		var groupGridFlag = true;
		var attributeGridFlag = true;
		var treeGridFlag = true;
		var selfDefinitionGridFlag = true;
		
		Ext.onReady(function(){
			window.frames["baseGridFrame"].location = "<c:url value='/sample/component/demogrid/baseGrid.jsp'/>";
			baseGridFlag = false;
		})
		
		function tabChg(tab,pan){
			var id = pan.id;
			if((id=="baseGridPan") && (baseGridFlag==true)){
				window.frames["baseGridFrame"].location = "<c:url value='/sample/component/demogrid/baseGrid.jsp'/>";
				baseGridFlag = false;
			}else if((id=="countGridPan") && (countGridFlag==true)){
    			window.frames["countGridFrame"].location = "<c:url value='/sample/component/demogrid/countGrid.jsp'/>";
    			countGridFlag = false;
    		}else if((id=="exportGridPan") && (exportGridFlag==true)){
    			window.frames["exportGridFrame"].location = "<c:url value='/sample/component/demogrid/exportGrid.jsp'/>";
    			exportGridFlag = false;
    		}else if((id=="editGridPan") && (editGridFlag==true)){
    			window.frames["editGridFrame"].location = "<c:url value='/sample/component/demogrid/editGrid.jsp'/>";
    			editGridFlag = false;
    		}else if((id=="dyncGridPan") && (dyncGridFlag==true)){
    			window.frames["dyncGridFrame"].location = "<c:url value='/sample/component/demogrid/dyncGrid.jsp'/>";
    			dyncGridFlag = false;
    		}else if((id=="groupGridPan") && (groupGridFlag==true)){
    			window.frames["groupGridFrame"].location = "<c:url value='/sample/component/demogrid/groupGrid.jsp'/>";
    			groupGridFlag = false;
    		}else if((id=="attributeGridPan") && (attributeGridFlag==true)){
    			window.frames["attributeGridFrame"].location = "<c:url value='/sample/component/demogrid/attributeGrid.jsp'/>";
    			attributeGridFlag = false;
    		}else if((id=="treeGridPan") && (treeGridFlag==true)){
    			window.frames["treeGridFrame"].location = "<c:url value='/sample/component/demogrid/treeGrid.jsp'/>";
    			treeGridFlag = false;
    		}else if((id=="selfDefinitionGridPan") && (selfDefinitionGridFlag==true)){
    			window.frames["selfDefinitionGridFrame"].location = "<c:url value='/sample/component/demogrid/selfDefinitionGrid.jsp'/>";
    			selfDefinitionGridFlag = false;
    		}
		}
		
		function resetHeight(t){
			window.frames[t.id].resetHeight(t.id);
		}
	</script>
</html>
